package com.yfp.client.util;

import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;
import javax.imageio.ImageIO;

/**
 * @Description: 图片处理
 *
 * @CreateDate: 2024/7/19 11:11
 * @UpdateUser:
 * @UpdateDate: 2024/7/19 11:11
 * @UpdateRemark: 暂无修改
 * @Version: 1.0
 */
public class ImageColorReader {

    public static java.awt.Color getColorAt(String imagePath, int x, int y) throws IOException {
        BufferedImage image = ImageIO.read(new File(imagePath));
        return new java.awt.Color(image.getRGB(x, y));
    }

    public static void main(String[] args) {
        try {
            java.awt.Color color = getColorAt("path/to/your/image.jpg", 100, 200); // 替换为实际路径和坐标
            System.out.println("Color at (100, 200): " + color);
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}